using System;
using System.Collections.Generic;
using Headsight.BPMN2WF.BPMN.Schemas;
using Headsight.BPMN2WF.Testing.TestObjCtors;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Headsight.BPMN2WF.BPMN.Model
{
    [TestClass]
    public class BPMNFlowNodeTest : BPMNBaseElementTestFixture<BPMNFlowNode, tFlowNode>
    {
        private IList<BPMNArgument> _bpmnArgsIn;
        private IList<BPMNArgument> _bpmnArgsOut;

        protected override tFlowNode CreateTElement()
        {
            return new tFlowNodeCtor().Create();
        }

        protected override BPMNFlowNode CreateSut(tFlowNode tProcess, string expectedId)
        {
            _bpmnArgsIn = new List<BPMNArgument>();
            _bpmnArgsOut = new List<BPMNArgument>();

            tProcess.id = expectedId;

            return new BPMNFlowNode(tProcess, _bpmnArgsIn, _bpmnArgsOut);
        }

        [TestMethod]
        public override void Id()
        {
            Assert.AreEqual("**id**", _sut.Id);
        }

        [TestMethod]
        public void ArgumentsIn()
        {
            Assert.AreSame(_bpmnArgsIn, _sut.ArgumentsIn);
        }

        [TestMethod]
        public void ArgumentsOut()
        {
            Assert.AreSame(_bpmnArgsOut, _sut.ArgumentsOut);
        }

        [TestMethod]
        public override void TestToString()
        {
            _sut = CreateSut(CreateTElement(), "*id*");
            _sut.TElement.name = "*name*";

            var act = _sut.ToString();
            const String exp = "BPMNFlowNode[Id: *id*, Name: *name*]";

            Assert.AreEqual(exp, act);

        }
    }
}